#ifndef 	__GPS_H__
#define		__GPS_H__	

#include "fifo.h"
#include "def.h"


enum NP_STATE 
{
	NP_STATE_SOM =0,
	NP_STATE_CMD,
	NP_STATE_DATA,
	NP_STATE_CHECKSUM_1,
	NP_STATE_CHECKSUM_2,
}; 

typedef struct
{
	BYTE gpsStatus;
	
	UINT32 longitude;
	UINT32 atitude;

	UINT16 gpsTimeYear;
	BYTE gpsTimeMonth;
	BYTE gpsTimeDay;
	BYTE gpsTimeHour;
	BYTE gpsTimeMin;
	BYTE gpsTimeSec;
	UINT32 gpsTime;
}T_GPS_INFO;


typedef struct
{
	BYTE gpsPowerStatus;
	BYTE gpsGetDataStatus;
	BYTE gpsGetGPRMCStatus;
	BYTE gpsCmdCheckSum;
	BYTE gpsTempCmdCheckSum;
	char recGpsData[32];
	BYTE recGpsDataCnt;
	
	char recGpsCmdData[128];
	BYTE recGpsCmdDataCnt;
	
	UINT32 gpsDebugDelayTimer;
	UINT32 gpsPrintDelayTimer;
	T_GPS_INFO gpsLocInfo;
}T_GPSTASK_INFO;


#ifndef 	_TBOX_GPS_
	#define		GPS_EXTERN		extern
	EXPORT_FIFO_API(GPSRxFifo,300,BYTE,UINT16)
#else
	#define		GPS_EXTERN
	NEW_FIFO(GPSRxFifo,300,BYTE,UINT16)
#endif
	


GPS_EXTERN T_GPSTASK_INFO gpsTaskInfo; 

GPS_EXTERN void gspProc(void);
GPS_EXTERN void gpsTaskDeInit(void);
GPS_EXTERN void gpsTaskInit(void);
GPS_EXTERN void ipcEventGPSComm(ULONG enumWhatEvent,ULONG lPara,BYTE *p,UINT16 length);









#endif
